package com.yunhe.sms.service.activite.impl;

import com.yunhe.commens.dto.Pagedao;
import com.yunhe.sms.dao.activite.VoteDao;
import com.yunhe.sms.dao.activite.impl.VoteDaoImpl;
import com.yunhe.sms.entity.activity.Vote;
import com.yunhe.sms.service.activite.VoteService;

import java.util.List;

/**
 * @author LeiPeifeng
 * @version V1.0
 * @date 2017/10/30 0030 19:05
 * @Description: 实现接口
 */
public class VoteServiceImpl implements VoteService{
    private VoteDao voteDao = new VoteDaoImpl ();

    @Override
    public Long add(Vote vote) {
        return voteDao.add ( vote );
    }

    @Override
    public void deleted(String ids) {
        if (null != ids && !ids.isEmpty ()){
            String[] split = ids.split ( "," );
            for (String id : split){
                voteDao.deleted ( new Long(id) );
            }
        }
    }

    @Override
    public void update(Vote vote) {
        voteDao.update ( vote );
    }

    @Override
    public Vote findId(Long id) {
        return voteDao.findId ( id );
    }

    @Override
    public List<Vote> find() {
        return voteDao.find ();
    }

    @Override
    public Pagedao<Vote> page(int offset, int limit) {
        return voteDao.page ( offset,limit );
    }

    @Override
    public void upstatus(Long id) {
        voteDao.upstatus ( id );
    }
}
